<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/4/28
  Time: 19:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>搜索结果</title>
</head>
<body>
<%@ page contentType="text/html;charset=UTF-8" language="java"
         import="com.entity.*,com.servlet.*,java.util.*" %>
<%@ page import="com.servlet.SelectAll" %>
<html>
<head>
    <title>查询页面</title>
</head>
<body>
<table border="1">
    <tr>
        <td>学号</td>
        <td>名字</td>
        <td>性别</td>
        <td>班级</td>
        <td></td>
        <td></td>
    </tr>
    <%--
  创建得到数据的类对象并调用得到List的方法然后遍历输出打印
    --%>
    <% List<Students> list =(List<Students>)request.getAttribute("stuList");
        for (Students students : list) {
    %>
    <tr>
        <td>
            <% out.print(students.getSid());%>
        </td>
        <td>
            <% out.print(students.getSname());%>
        </td>
        <td>
            <% out.print(students.getSage());%>
        </td>
        <td>
            <% out.print(students.getSclass());%>
        </td>
        <td><a href="update.jsp?Sid=<% out.print(students.getSid());%>">编辑</a></td>
        <td><a href="DeleteServlet?Sid=<% out.print(students.getSid());%>">删除</a></td>
    </tr>
    <% } %>
</table>
<a href="insert.jsp">新增</a>
</body>
</html>
